// InitSkin.h: interface for the CInitSkin class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_INITSKIN_H__919E37E8_64FD_11D9_9AC6_0050BAD093CF__INCLUDED_)
#define AFX_INITSKIN_H__919E37E8_64FD_11D9_9AC6_0050BAD093CF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "SkinResMgr.h"

#include "MainWndSubclass.h"
#include "ButtonSubclass.h"
#include "EditSubclass.h"
#include "ListCtrlSubclass.h"
#include "ComboBoxSubclass.h"
#include "StaticSubclass.h"
#include "TreeCtrlSubclass.h"
#include "MenuWndSubclass.h"

#include <afxtempl.h>

enum WindowType{
	wtUnknown,
	wtFrameWnd,
	wtDlg,
	wtEdit,
	wtListCtrl,
	wtComboBox,
	wtButton,
	wtStatic,
	wtTreeCtrl,
	wtMenuWnd
};

//////////////////////////////////////////////////////////////////////
#define InitSkin (CInitSkin::GetInitskin())
//////////////////////////////////////////////////////////////////////

class CInitSkin : public CObject  
{
public:
	CInitSkin();
	virtual ~CInitSkin();

protected:
	static BOOL CALLBACK SkinEnumChildProc(HWND hwnd, LPARAM lParam);
	static BOOL CALLBACK SkinEnumThreadWndProc(HWND hwnd, LPARAM lParam);
	static LRESULT CALLBACK SkinHookProc(int iCode, WPARAM wParam, LPARAM lParam);
	static HHOOK m_hPrevSkinHook;

public:
	void InstallSkin(CString strFileName);
	void UnInstallSkin();
	static CInitSkin& GetInitskin();

private:
	static WindowType GetWindowType(HWND hWnd);
	static CList<CWndSubclass*, CWndSubclass*> m_lstWndSubclass;
	static void HookWindow(HWND hWnd);

private:
	CSkinResMgr m_skinResMgr;
	BOOL InitializeResource(CString strFileName);
	BOOL FinalizeResource();
};

#endif // !defined(AFX_INITSKIN_H__919E37E8_64FD_11D9_9AC6_0050BAD093CF__INCLUDED_)
